package com.exercise.DesignPattern.BehavioralPatterns.ChainOfResponsibilityPattern;

// 客户端代码
public class Client {
    public static void main(String[] args) {
        Handler handlerA = new ConcreteHandlerA();
        Handler handlerB = new ConcreteHandlerB();
        handlerA.setNextHandler(handlerB);

        handlerA.handleRequest("A");  // 处理请求A
        handlerA.handleRequest("B");  // 处理请求B
        handlerA.handleRequest("C");  // 无处理者
    }
}